<template>
	<view style="position: relative;">
		<view class="padding" >
			<view class="search" v-if="!showSearch">
				<view class="back" @click="goback"><image src="../../static/images/back_blue.png" class="back-icon"></image></view>
				<view class="title">我的收藏</view>
				<image src="../../static/images/search.png" class="search-icon" @click="showSearch = true" ></image>
			</view>
			<view class="search" v-if="showSearch">
				<image src="../../static/images/search.png" class="search-icon" style="margin-left: 10px;"></image>
				<view style="width: calc(100% - 120px);"> 
					<u-input placeholder="单行输入" style="font-size: 20px;" placeholder-style="font-size:20px"
					 fontSize="20" border="none" class="search-class" v-model="keyword" ></u-input>
				</view>
				<view class="cancel" @click="showSearch = false">取消</view>
			</view>
			
				<view class="bg">
					<view v-for="item in 4" class="item">
						<view class="book"></view>
						<view class="row-between-center" style="width: calc(100% - 45px);">
							<view class="item-info" >
								<view class="name">
									作品名称
								</view>
								<view class="desc">作者</view>
							</view>
							<image src="../../static/images/fa-star.svg" class="forcuse"></image>
						</view>
					
					</view>
				</view>
		</view>

		
	</view>
</template>

<script>
	import titlebar from '@/pages/common/titlebar.vue'
	import {
		getCollect,
	} from '@/api/change/index.js'
	export default {
		components:{
				titlebar
		},
		data() {
			return {
				showManage:false,
				showSearch:false,
				list:[],
				keyword:''
			}
		},
		
		onLoad() {
			this.getData()
		},
		
		methods: {
			goback(){
				uni.navigateBack()
			},
			getData(){
				getCollect({keyword:this.keyword}).then(res=>{
					this.list =res.data
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.forcuse{
		right: 0;
		width: 40px;
		height: 40px;
	}
	.bg{
		padding: 18px 25px 18px 25px;
		margin-left: 20px;
		margin-top: 25px;
		width: calc(100% - 40px);
		line-height: 20px;
		border-radius: 25px;
		background-color: rgba(255, 255, 255, 1);
		color: rgba(16, 16, 16, 1);
		font-size: 14px;
		text-align: center;
		font-family: Arial;
		border: 3px solid rgba(79, 79, 79, 1);
	}
	.item{
		margin-top: 10px;
		display: flex;
		width: 100%;
		height: 80px;
		padding: 0 10px;
		align-items: center;
		line-height: 20px;
		border-radius: 25px;
		background-color: rgba(255, 255, 255, 1);
		color: rgba(16, 16, 16, 1);
		font-size: 14px;
		text-align: center;
		font-family: Arial;
		border: 3px solid rgba(79, 79, 79, 1);
		
	}
	.item-info{
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		margin-left: 10px;justify-content: space-arround;height: 60px;padding-top: 5px;padding-bottom: 5px;
	}
	.book{
		width: 45px;
		height: 60px;
		border-radius: 10px;
		border: 3px solid rgba(79, 79, 79, 1);
	}
	.name{
		color: rgba(16, 16, 16, 1);
		font-size: 18px;
		text-align: left;
		font-family: HappyZcool-2016;
	}
	.desc{
		margin-top: 10px;
		color: rgba(16, 16, 16, 1);
		font-size: 14px;
		text-align: left;
			font-family: HappyZcool-2016;
	}
	.padding {
		margin-top: 10px;
			padding-left: 20px;
			padding-right: 20px;
		}
	.search{
		height: 60px;
		line-height: 20px;
		border-radius: 25px;
		background-color: rgba(255, 255, 255, 1);
		color: rgba(16, 16, 16, 1);
		font-size: 14px;
		text-align: center;
		font-family: Arial;
		border: 3px solid rgba(79, 79, 79, 1);
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.back{
		margin-left: 10px;
		width: 40px;
		height: 40px;
		background-color: rgba(147, 210, 243, 1);
		text-align: center;
		border: 3px solid rgba(79, 79, 79, 1);
		display: flex;
		border-radius: 50%;
		align-items: center;
		justify-content: center;
	}
	.title{
		color: rgba(79, 79, 79, 1);
		font-size: 28px;
		text-align: center;
	font-family: HappyZcool-2016;
	}
	.search-icon{
		width: 40px;
		height: 40px;
		margin-right: 10px;
	}
	.search-icon2{
		width: 40px;
		height: 40px;
	}
	.back-icon{
		width: 19px;
		height: 19px;
	}
	.cancel{
		white-space:nowrap;
		margin-right: 10px;
		color: rgba(64, 149, 229, 1);
		font-size: 28px;
		text-align: center;
	font-family: HappyZcool-2016;
	margin-right: 30px;
	}
	.bottom{
		width: 100vw;
		position: fixed;
		bottom: 0;
		height: 100px;
		line-height: 20px;
		border-radius: 25px 25px 0 0 ;
		background-color: rgba(255, 255, 255, 1);
		text-align: center;
		border: 3px solid rgba(79, 79, 79, 1);
		display: flex;
		justify-content: center;
	}
	.btn{
		margin-top: 16px;
		margin-left: 20px;
		margin-right: 20px;
		width: calc(100% - 40rpx);
		height: 50px;
		line-height: 20px;
		border-radius: 20px;
		font-family: HappyZcool-2016;
		font-size: 32px;
		color: rgba(16, 16, 16, 1);
		background-color: rgba(255, 191, 107, 1);
		text-align: center;
		border: 3px solid rgba(79, 79, 79, 1);
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.all{
		color: rgba(16, 16, 16, 1);
		font-size: 28px;
		font-family: HappyZcool-2016;
	}
	.choose{
		display: flex;
		justify-content: space-between;
		margin-left: 20px;
		margin-right: 20px;
		align-items: center;
		width: calc(100% - 40rpx);
		
	}
</style>
